package com.hhf.feiojapiservice.fallback;

import com.hhf.feiojapiservice.client.JudgeFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.Collections;

/**
 * @Author hhf
 * @Date 2024/11/3
 * @Description
 */
@Slf4j
public class JudgeClientFallbackFactory implements FallbackFactory<JudgeFeignClient> {
    @Override
    public JudgeFeignClient create(Throwable cause) {
        return new JudgeFeignClient() {
            @Override
            public void doJudge(long questionSubmitId) {
                log.error("JudgeFeignClient doJudge error:{}",cause.getMessage());
            }
        };
    }
}
